using System;
using bitzhuwei.Compiler;

namespace bitzhuwei.GLSLFormat {
    /// <summary>
    /// Correspond to the Vn node storage_qualifier in the grammar(GLSL).
    /// </summary>
    internal partial class Vnstorage_qualifier : IFullFormat {
        // [143] storage_qualifier = 'const' ;
        // [144] storage_qualifier = 'in' ;
        // [145] storage_qualifier = 'out' ;
        // [146] storage_qualifier = 'inout' ;
        // [147] storage_qualifier = 'centroid' ;
        // [148] storage_qualifier = 'patch' ;
        // [149] storage_qualifier = 'sample' ;
        // [150] storage_qualifier = 'uniform' ;
        // [151] storage_qualifier = 'buffer' ;
        // [152] storage_qualifier = 'shared' ;
        // [153] storage_qualifier = 'coherent' ;
        // [154] storage_qualifier = 'volatile' ;
        // [155] storage_qualifier = 'restrict' ;
        // [156] storage_qualifier = 'readonly' ;
        // [157] storage_qualifier = 'writeonly' ;
        // [158] storage_qualifier = 'subroutine' ;
        // [159] storage_qualifier = 'subroutine' '(' type_name_list ')' ;


        private readonly IFullFormat complex;

        private readonly TokenRange _scope;
        public TokenRange Scope => _scope;
        public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
            context.PrintBlanksAnd(this.complex, preConfig, writer);
        }


        // [143] storage_qualifier = 'const' ;
        public Vnstorage_qualifier(Token r0) {
            this.complex = new complex0(r0);
            this._scope = new TokenRange(r0);
        }
        class complex0 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                context.PrintBlanksAnd(r0, preConfig, writer);
            }
            public readonly Token r0;
            public complex0(Token r0) {
                this.r0 = r0;
                this._scope = new TokenRange(r0);
            }
        }

        // [144] storage_qualifier = 'in' ;
        // complex1 repeated with complex0

        // [145] storage_qualifier = 'out' ;
        // complex2 repeated with complex0

        // [146] storage_qualifier = 'inout' ;
        // complex3 repeated with complex0

        // [147] storage_qualifier = 'centroid' ;
        // complex4 repeated with complex0

        // [148] storage_qualifier = 'patch' ;
        // complex5 repeated with complex0

        // [149] storage_qualifier = 'sample' ;
        // complex6 repeated with complex0

        // [150] storage_qualifier = 'uniform' ;
        // complex7 repeated with complex0

        // [151] storage_qualifier = 'buffer' ;
        // complex8 repeated with complex0

        // [152] storage_qualifier = 'shared' ;
        // complex9 repeated with complex0

        // [153] storage_qualifier = 'coherent' ;
        // complex10 repeated with complex0

        // [154] storage_qualifier = 'volatile' ;
        // complex11 repeated with complex0

        // [155] storage_qualifier = 'restrict' ;
        // complex12 repeated with complex0

        // [156] storage_qualifier = 'readonly' ;
        // complex13 repeated with complex0

        // [157] storage_qualifier = 'writeonly' ;
        // complex14 repeated with complex0

        // [158] storage_qualifier = 'subroutine' ;
        // complex15 repeated with complex0

        // [159] storage_qualifier = 'subroutine' '(' type_name_list ')' ;
        public Vnstorage_qualifier(Token r3, Token r2, Vntype_name_list r1, Token r0) {
            this.complex = new complex16(r3, r2, r1, r0);
            this._scope = new TokenRange(r3, r0);
        }
        class complex16 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                var config = new BlankConfig();
                context.PrintBlanksAnd(r3, preConfig, writer);
                context.PrintCommentsBetween(r3, r2, config, writer);
                context.PrintBlanksAnd(r2, config, writer);
                context.PrintCommentsBetween(r2, r1, config, writer);
                context.PrintBlanksAnd(r1, config, writer);
                context.PrintCommentsBetween(r1, r0, config, writer);
                context.PrintBlanksAnd(r0, config, writer);
            }
            public readonly Token r3;
            public readonly Token r2;
            public readonly Vntype_name_list r1;
            public readonly Token r0;
            public complex16(Token r3, Token r2, Vntype_name_list r1, Token r0) {
                this.r3 = r3;
                this.r2 = r2;
                this.r1 = r1;
                this.r0 = r0;
                this._scope = new TokenRange(r3, r0);
            }
        }



    }
}
